<?php
namespace app\common\validate;

class ManageValidate extends BaseValidate
{
    /**
     * 定义验证规则
     * 格式：‘字段名’ => ['规则1'，‘规则2’...]
     * @var string[]
     */
    protected $rule = [
        'username' => 'require',
        'password' => 'require'
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' => '错误信息'
     * @var string[]
     */
    protected $message = [
        'username.require' => '用户名不能为空',
        'password.require' => '密码不能为空'
    ];

    /**
     * 验证场景
     *
     * @var array[]
     */
    protected $scene = [
      'login' => ['username','password']
    ];
}